package cn.shop.admin.entity.rateModule;

import cn.shop.validation.Save;
import cn.shop.validation.Update;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @author jzw
 * @since 2021-12-21 14:23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Rate {

	private Long id;

	/**
	 * 费率名称
	 */
	@NotNull(message = "费率名称不能为空", groups = Save.class)
	private String name;

	/**
	 * 费率值
	 */
	@Range(max = 100, min = 0, message = "服务费率 合法范围为:1-100", groups = {Save.class, Update.class})
	@NotNull(message = "服务费率不能为空", groups = Save.class)
	private BigDecimal rate;

}
